fn main() {
    let box_i32 = Box::new(5i32);
    let stack_i32 = 37i32;
    borrow_i32(&box_i32);
    borrow_i32(&box_i32);
    borrow_i32(&stack_i32);

    {
        let _ref_to_i32: &i32 = &box_i32;
        // 这里吃掉后，最后的就报错
        // eat_box_i32(box_i32);

        borrow_i32(_ref_to_i32);
        borrow_i32(_ref_to_i32);
    }

    eat_box_i32(box_i32);
}

fn eat_box_i32(boxed: Box<i32>) {
    println!("drop {}", boxed);
}

fn borrow_i32(borrowed_i32: &i32) {
    println!("borrowed {}", borrowed_i32);
}
